function anonymous(source, target, routesList) {
    "use strict";
    return new Promise((_resolve, _reject) => {
        var _sync = true;
        var _context;
        var _x = this._x;
        var _fn0 = _x[0];
        var _hasResult0 = false;
        _fn0(source, target, routesList).then(_result0 => {
            _hasResult0 = true;
            if (_result0 !== undefined) {
                _resolve(_result0);;
            } else {
                var _fn1 = _x[1];
                var _hasResult1 = false;
                _fn1(source, target, routesList).then(_result1 => {
                    _hasResult1 = true;
                    if (_result1 !== undefined) {
                        _resolve(_result1);;
                    } else {
                        _resolve();
                    }
                }, _err1 => {
                    if (_hasResult1) throw _err1;
                    if (_sync)
                        _resolve(Promise.resolve().then(() => {
                            throw _err1;
                        }));
                    else
                        _reject(_err1);
                });
            }
        }, _err0 => {
            if (_hasResult0) throw _err0;
            if (_sync)
                _resolve(Promise.resolve().then(() => {
                    throw _err0;
                }));
            else
                _reject(_err0);
        });
        _sync = false;
    });
}